import {createRouter, createWebHashHistory} from 'vue-router'
import Login from "@/views/Login.vue";
import Register from "../views/Register.vue";
import Login2 from "@/views/Login2.vue";
import SysMain from "@/views/SysMain.vue";
import ECharts from "@/views/Fli/ECharts.vue";
import AddFlight from "@/views/FlightMan/AddFlight.vue";
import CancelFlight from "@/views/FlightMan/CancelFlight.vue";
import AlterFlight from "@/views/FlightMan/AlterFlight.vue";
import SelectAlter from "@/views/FlightSelect/SelectAlter.vue";
import Visitor from "@/views/FlightSelect/Visitor.vue";
import SelectUser from "@/views/FlightSelect/SelectUser.vue";
import SelectFlight from "@/views/FlightSelect/SelectFlight.vue";
import Luggage from "@/views/FlightSelect/Luggage.vue";
import FlightState from "@/views/InfoTotal/FlightState.vue";
import FlightType from "@/views/InfoTotal/FlightType.vue";
import FlightRequest from "@/views/FlightAlter/FlightRequest.vue";
import FlightAlter from "@/views/FlightAlter/FlightAlter.vue";

import UserMan from "@/views/Manager/UserMan.vue";
import Animal from "@/views/FlightSelect/Animal.vue";
import FlightStatical from "@/views/InfoTotal/FlightStatical.vue";
import FlightMap from "@/views/InfoTotal/FlightMap.vue";
import Flightstationbaidumap from "@/views/FlightSelect/Flightstationbaidumap.vue";
import LogAOPInforMan from "@/views/Manager/LogAOPInforMan.vue";



const routes = [
  {
    path: '/',
    name: 'Login',
    component: Login,
  }, {
    path: '/Register',
    name: 'Register',
    component: Register,
  },
  {
    path: '/Login2',
    name: 'Login2',
    component: Login2
  }, {
    path: '/main',
    component: SysMain,
    redirect: '/main/echarts',
    children: [
      {
        path: 'echarts',
        component: ECharts
      }
    ]
  },
  {
    path: '/main',
    component: SysMain,
    children: [
      {
        path: 'userman',
        component: UserMan
      },
      {
        path: 'logaopman',
        component: LogAOPInforMan
      }
    ]
  },
  {
    path: '/main',
    component: SysMain,
    children: [
      {
        path: 'addflight',
        component: AddFlight
      },
      {
        path: 'cancelflight',
        component: CancelFlight
      },
      {
        path: 'alterflight',
        component: AlterFlight
      }
    ]
  },
  {
    path: '/main',
    component: SysMain,
    children: [
      {
        path: 'luggage',
        component: Luggage
      },
      {
        path: 'selectalter',
        component: SelectAlter
      },
      {
        path: 'selectflight',
        component: SelectFlight
      },
      {
        path: 'selectuser',
        component: SelectUser
      },
      {
        path: 'visitor',
        component: Visitor
      },
      {
        path: 'animal',
        component: Animal
      },
      {
        path: 'flightstationbaidumap',
        component: Flightstationbaidumap
      }

    ]
  },
  {
    path: '/main',
    component: SysMain,
    children: [
      {
        path: 'flightstate',
        component: FlightState
      },
      {
        path: 'flighttype',
        component: FlightType
      },
      {
        path: 'flightstatical',
        component: FlightStatical
      },
      {
        path: 'flightmap',
        component: FlightMap
      }
    ]
  },
  {
    path: '/main',
    component: SysMain,
    children: [
      {
        path: 'flightalter',
        component: FlightAlter
      },
      {
        path: 'flightrequest',
        component: FlightRequest
      }
    ]
  }

]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
